﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using AtKardesler.Data;
using AtKardesler.Cache;
namespace AtKardesler.UIProcess
{
    public abstract class BasePage : Page
    {
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (Page.IsPostBack)
            {
                GetStateFromUI();
            }

            else
            {
                SetUIFromState();
            }
        }

        protected override void InitializeCulture()
        {
            base.InitializeCulture();
            System.Globalization.CultureInfo cultureInfo = System.Globalization.CultureInfo.GetCultureInfo("tr-TR");
            System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo;
        }




        public abstract void GetStateFromUI();
        public abstract void SetUIFromState();

        public User[] Users
        {
            get
            {
                AtKardesler.Data.Users _Users = CacheManager.Instance.GetItemFromCache("USERS_") as Users;
                return _Users.User;
            }
        }
    }
}
